<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			
//				$("tr:eq(0)").css("background-color","yellow");
//				$("tr:gt(0):odd").css("background-color","green");
//				function cli1(){
//					console.log($("#inputId").prop("checked"));
//					$(".goods").each(function(){
//						$(this).prop("checked",$("#inputId").prop("checked"));
//					});
//				}
				$(function(){
					$("#inputId").change(function(){
						$(".goods").each(function(){
							$(this).prop("checked",$("#inputId").prop("checked"));
						});
					});	
				});
				
			
			
		</script>
	</head>
	<body>
		<table border="1px"cellpadding="0" cellspacing="0" width="600px">
			<tr>
				<td>
					<input type="checkbox" id="inputId" "/></td>
				<td>序号</td>
				<td>名称</td>
				<td>价格</td>
				<td>数量</td>
			</tr>
			<tr>
				<td><input class="goods" type="checkbox" /></td>
				<td>1</td>				
				<td>htc</td>
				<td>3200</td>				
				<td>10</td>				
			</tr>
			<tr>
				<td><input class="goods" type="checkbox" /></td>
				<td>2</td>				
				<td>apple</td>				
				<td>4400</td>				
				<td>13</td>				
			</tr>
			<tr>
				<td><input class="goods" type="checkbox" /></td>
				<td>3</td>				
				<td>nokia</td>				
				<td>42300</td>				
				<td>22</td>	
			</tr>
			<tr>
				<td><input class="goods" type="checkbox" /></td>
				<td>4</td>				
				<td>samsung</td>				
				<td>3500</td>				
				<td>35</td>	
			</tr>
			<tr>
				<td><input class="goods" type="checkbox" /></td>
				</td>
				<td>5</td>				
				<td>heimei</td>				
				<td>2500</td>				
				<td>127</td>	
			</tr>
		</table>
	</body>
</html>
